{% extends 'admin/index.html' %}
{% load crispy_forms_tags settings_tags %}


{% block content %}
<h1 class="h1 m-3"><i class="fa fa-gear fa-fw"></i> Settings</h1>

<div class="row bg-white p-5">
	<div class="col-5 col-sm-3">
		<div class="nav flex-column nav-tabs h-100" id="vert-tabs-tab" role="tablist" aria-orientation="vertical">
			<a class="nav-link active" id="vert-tabs-home-tab" data-toggle="pill" href="#vert-tabs-home" role="tab" aria-controls="vert-tabs-home" aria-selected="true">General</a>
			<a class="nav-link" id="vert-tabs-profile-tab" data-toggle="pill" href="#vert-tabs-profile" role="tab" aria-controls="vert-tabs-profile" aria-selected="false">Email (SMTP)</a>
			<a class="nav-link" id="vert-tabs-messages-tab" data-toggle="pill" href="#vert-tabs-messages" role="tab" aria-controls="vert-tabs-messages" aria-selected="false">Email Templates</a>
			<a class="nav-link" id="vert-tabs-settings-tab" data-toggle="pill" href="#vert-tabs-settings" role="tab" aria-controls="vert-tabs-settings" aria-selected="false">Contact Settings</a>
			<a class="nav-link" id="vert-tabs-initial-tab" data-toggle="pill" href="#vert-tabs-initial" role="tab" aria-controls="vert-tabs-initial" aria-selected="false">Initial Values</a>
		</div>
	</div>
	<div class="col-7 col-sm-9">
		<div class="tab-content" id="vert-tabs-tabContent">
			<div class="tab-pane text-left fade active show p-3" id="vert-tabs-home" role="tabpanel" aria-labelledby="vert-tabs-home-tab">
				<form method='POST' enctype="multipart/form-data">
					{% csrf_token %}
					{{ general_form|crispy }}
					<input type="hidden" name="section" value="general">
					<button type="submit" class="btn btn-primary">Save Settings</button>
				</form>

			</div>
			<div class="tab-pane fade p-3" id="vert-tabs-profile" role="tabpanel" aria-labelledby="vert-tabs-profile-tab">
				<form method='POST'>
					{% csrf_token %}
					{{ email_form|crispy }}
					<input type="hidden" name="section" value="email">
					<button type="submit" class="btn btn-primary">Save Settings</button>
				</form>
			</div>
			<div class="tab-pane fade" id="vert-tabs-messages" role="tabpanel" aria-labelledby="vert-tabs-messages-tab">
				<form method="POST">
					{% csrf_token %}
					{{ mail_templates_form|crispy }}
					<input type="hidden" name="section" value="mail_templates">
					<button type="submit" class="btn btn-primary">Save Settings</button>
				</form>
			</div>
			<div class="tab-pane fade" id="vert-tabs-settings" role="tabpanel" aria-labelledby="vert-tabs-settings-tab">
				<form method="POST">
					{% csrf_token %}
					{{ contact_form|crispy }}
					<input type="hidden" name="section" value="contact_settings">
					<button type="submit" class="btn btn-primary">Save Settings</button>
				</form>
			</div>
			<div class="tab-pane fade" id="vert-tabs-initial" role="tabpanel" aria-labelledby="vert-tabs-initial-tab">
				<form method="POST">
					{% csrf_token %}
					{{ initial_form|crispy }}
					<input type="hidden" name="section" value="initial_values">
					<button type="submit" class="btn btn-primary">Save Settings</button>
				</form>
			</div>
		</div>
	</div>
</div>

{% endblock %}
